package edu.ustb.service;

import java.io.InputStream;

import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;


import edu.ustb.mapper.UserXiumiMapper;
import edu.ustb.utils.MybatisUtil;

public class UserXiumimaServiceImp implements UserXiumimaService {

	@Override
	public int changeByPhone(String userPhone, String newPassword) {
		UserXiumiMapper mapper=MybatisUtil.getMapper(UserXiumiMapper.class);
		
		int row =  mapper.UpdateByPhoneName(userPhone, newPassword);
		MybatisUtil.commit();
		return row;
	}

	@Override
	public int changeByEmail(String userEmail, String newPassword) {
		UserXiumiMapper mapper=MybatisUtil.getMapper(UserXiumiMapper.class);
		int row =  mapper.UpdateByPhoneName(userEmail, newPassword);
		MybatisUtil.commit();
		return row;
	}

	@Override
	public int Judge(String unkonw) {
		// TODO Auto-generated method stub
		return 0;
	}

}
